const mongoose = require("../config/db");
const moment = require('moment')
const activitySchema = mongoose.Schema({
  activity_name: {
    type: String,
    required: true,
  },
  start_time: {
    type: Date,
    default: moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
  },
  activity_state: {
    type: Number,
    default: 1, // 默认全部
    required: true,
  },
  creator: {
    type: String,
    required: true,
  },
}, {
  versionKey: false
})
const ActivityModel = mongoose.model("Activity", activitySchema, "activitys");
// ActivityModel.create({
//   "activity_name": "活动名称",
//   "start_time": '',
//   "creator": "创建者",
//   "activity_state": 3
// });
module.exports = ActivityModel;